Analysis of GLDS-44 from NASA GeneLab

This R markdown file was auto-generated by the iDEP website Using iDEP 0.91, originally by Steven

Ge SX, Son EW, Yao R: iDEP: an integrated web application for differential expression and pathway analysis of RNA-Seq data. BMC Bioinformatics 2018, 19(1):534. PMID:30567491

1. Read data

First we set up the working directory to where the files are saved.

 setwd('~/Documents/HTML_R/GLDS44')

R packages and iDEP core Functions. Users can also download the iDEP_core_functions.R file. Many R packages needs to be installed first. This may take hours. Each of these packages took years to develop.So be a patient thief. Sometimes dependencies needs to be installed manually. If you are using an older version of R, and having trouble with package installation, try un-install the current version of R, delete all folders and files (C:/Program Files/R/R-3.4.3), and reinstall from scratch.

 if(file.exists('iDEP_core_functions.R'))
    source('iDEP_core_functions.R') else 
    source('https://raw.githubusercontent.com/iDEP-SDSU/idep/master/shinyapps/idep/iDEP_core_functions.R') 

We are using the downloaded gene expression file where gene IDs has been converted to Ensembl gene IDs. This is because the ID conversion database is too large to download. You can use your original file if your file uses Ensembl ID, or you do not want to use the pathway files available in iDEP (or it is not available).

 inputFile <- 'GLDS44_Expression.csv'
 sampleInfoFile <- 'GLDS44_Sampleinfo.csv'
 gldsMetadataFile <- 'GLDS44_Metadata.csv'
 geneInfoFile <- 'Arabidopsis_thaliana__athaliana_eg_gene_GeneInfo.csv' #Gene symbols, location etc. 
 geneSetFile <- 'Arabidopsis_thaliana__athaliana_eg_gene.db'  # pathway database in SQL; can be GMT format 
 STRING10_speciesFile <- 'https://raw.githubusercontent.com/iDEP-SDSU/idep/master/shinyapps/idep/STRING10_species.csv' 

Parameters for reading data

 input_missingValue <- 'geneMedian' #Missing values imputation method
 input_dataFileFormat <- 1  #1- read counts, 2 FKPM/RPKM or DNA microarray
 input_minCounts <- 0.5 #Min counts
 input_NminSamples <- 1 #Minimum number of samples 
 input_countsLogStart <- 4  #Pseudo count for log CPM
 input_CountsTransform <- 1 #Methods for data transformation of counts. 1-EdgeR's logCPM 2-VST, 3-rlog 
readMetadata.out <- readMetadata(gldsMetadataFile)
library(knitr)   #  install if needed. for showing tables with kable
library(kableExtra)
kable( readMetadata.out ) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%")
Act23_FLT_Rep1 Act23_FLT_Rep2 Act23_FLT_Rep3 Act23_GC_Rep1 Act23_GC_Rep2 Act23_GC_Rep3 WT_FLT_Rep1 WT_FLT_Rep2 WT_FLT_Rep3 WT_GC_Rep1 WT_GC_Rep2 WT_GC_Rep3
Sample.LongId Atha.Col.0.wo.act2.3.FLT.Rep1.Array Atha.Col.0.wo.act2.3.FLT.Rep2.Array Atha.Col.0.wo.act2.3.FLT.Rep3.Array Atha.Col.0.wo.act2.3.GC.Rep1.Array Atha.Col.0.wo.act2.3.GC.Rep2.Array Atha.Col.0.wo.act2.3.GC.Rep3.Array Atha.Col.0.wo.WT.FLT.Rep1.Array Atha.Col.0.wo.WT.FLT.Rep2.Array Atha.Col.0.wo.WT.FLT.Rep3.Array Atha.Col.0.wo.WT.GC.Rep1.Array Atha.Col.0.wo.WT.GC.Rep2.Array Atha.Col.0.wo.WT.GC.Rep3.Array
Sample.Id Atha.Col.0.wo.act2.3.FLT.Rep1 Atha.Col.0.wo.act2.3.FLT.Rep2 Atha.Col.0.wo.act2.3.FLT.Rep3 Atha.Col.0.wo.act2.3.GC.Rep1 Atha.Col.0.wo.act2.3.GC.Rep2 Atha.Col.0.wo.act2.3.GC.Rep3 Atha.Col.0.wo.WT.FLT.Rep1 Atha.Col.0.wo.WT.FLT.Rep2 Atha.Col.0.wo.WT.FLT.Rep3 Atha.Col.0.wo.WT.GC.Rep1 Atha.Col.0.wo.WT.GC.Rep2 Atha.Col.0.wo.WT.GC.Rep3
Sample.Name Atha_Col-0_wo_act2-3_FLT_Rep1 Atha_Col-0_wo_act2-3_FLT_Rep2 Atha_Col-0_wo_act2-3_FLT_Rep3 Atha_Col-0_wo_act2-3_GC_Rep1 Atha_Col-0_wo_act2-3_GC_Rep2 Atha_Col-0_wo_act2-3_GC_Rep3 Atha_Col-0_wo_WT_FLT_Rep1 Atha_Col-0_wo_WT_FLT_Rep2 Atha_Col-0_wo_WT_FLT_Rep3 Atha_Col-0_wo_WT_GC_Rep1 Atha_Col-0_wo_WT_GC_Rep2 Atha_Col-0_wo_WT_GC_Rep3
GLDS 44 44 44 44 44 44 44 44 44 44 44 44
Accession GLDS-44 GLDS-44 GLDS-44 GLDS-44 GLDS-44 GLDS-44 GLDS-44 GLDS-44 GLDS-44 GLDS-44 GLDS-44 GLDS-44
Hardware BRIC BRIC BRIC BRIC BRIC BRIC BRIC BRIC BRIC BRIC BRIC BRIC
Tissue Etiolated seedling Etiolated seedling Etiolated seedling Etiolated seedling Etiolated seedling Etiolated seedling Etiolated seedling Etiolated seedling Etiolated seedling Etiolated seedling Etiolated seedling Etiolated seedling
Age 14 days 14 days 14 days 14 days 14 days 14 days 14 days 14 days 14 days 14 days 14 days 14 days
Organism Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana Arabidopsis thaliana
Ecotype Col-0 Col-0 Col-0 Col-0 Col-0 Col-0 Col-0 Col-0 Col-0 Col-0 Col-0 Col-0
Genotype act2-3 act2-3 act2-3 act2-3 act2-3 act2-3 WT WT WT WT WT WT
Variety Col-0 act2-3 Col-0 act2-3 Col-0 act2-3 Col-0 act2-3 Col-0 act2-3 Col-0 act2-3 Col-0 WT Col-0 WT Col-0 WT Col-0 WT Col-0 WT Col-0 WT
Radiation Cosmic radiation Cosmic radiation Cosmic radiation Background Earth Background Earth Background Earth Cosmic radiation Cosmic radiation Cosmic radiation Background Earth Background Earth Background Earth
Gravity Microgravity Microgravity Microgravity Terrestrial Terrestrial Terrestrial Microgravity Microgravity Microgravity Terrestrial Terrestrial Terrestrial
Developmental Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings Etiolated 12 day old seedlings
Time.series.or.Concentration.gradient Single time point Single time point Single time point Single time point Single time point Single time point Single time point Single time point Single time point Single time point Single time point Single time point
Light Dark Dark Dark Dark Dark Dark Dark Dark Dark Dark Dark Dark
Assay..RNAseq. Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling Microarray Transcription Profiling
Temperature Ambient shuttle Ambient shuttle Ambient shuttle Ambient shuttle Ambient shuttle Ambient shuttle Ambient shuttle Ambient shuttle Ambient shuttle Ambient shuttle Ambient shuttle Ambient shuttle
Treatment.type Space flight Space flight Space flight Space flight Space flight Space flight Space flight Space flight Space flight Space flight Space flight Space flight
Treatment.intensity x x x x x x x x x x x x
Treament.timing x x x x x x x x x x x x
Preservation.Method. RNAlater RNAlater RNAlater RNAlater RNAlater RNAlater RNAlater RNAlater RNAlater RNAlater RNAlater RNAlater
 readData.out <- readData(inputFile) 
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
   kable( head(readData.out$data) ) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%") 
Act23_FLT_Rep1 Act23_FLT_Rep2 Act23_FLT_Rep3 Act23_GC_Rep1 Act23_GC_Rep2 Act23_GC_Rep3 WT_FLT_Rep1 WT_FLT_Rep2 WT_FLT_Rep3 WT_GC_Rep1 WT_GC_Rep2 WT_GC_Rep3
AT3G18780 3.169925 3.169925 3.169925 3.169925 3.169925 3.321928 4.169925 4.087463 4.087463 4.087463 4.169925 4.087463
AT3G62680 2.807355 2.807355 2.807355 3.459432 3.459432 3.459432 2.807355 2.807355 2.807355 3.459432 3.584963 3.584963
AT1G05240 2.807355 2.807355 2.807355 3.459432 3.459432 3.459432 2.807355 3.000000 3.000000 3.584963 3.700440 3.700440
AT4G25820 2.807355 2.807355 2.807355 3.459432 3.459432 3.459432 2.807355 3.000000 3.000000 3.459432 3.584963 3.584963
AT5G46890 3.459432 3.459432 3.169925 3.807355 3.807355 3.700440 3.321928 3.169925 3.459432 3.700440 3.807355 3.807355
AT4G02270 3.169925 3.000000 3.000000 3.584963 3.584963 3.584963 3.000000 3.169925 3.321928 3.584963 3.700440 3.700440
 readSampleInfo.out <- readSampleInfo(sampleInfoFile) 
 kable( readSampleInfo.out ) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%") 
Gravity Genotype
Act23_FLT_Rep1 Microgravity Act23
Act23_FLT_Rep2 Microgravity Act23
Act23_FLT_Rep3 Microgravity Act23
Act23_GC_Rep1 Terrestrial Act23
Act23_GC_Rep2 Terrestrial Act23
Act23_GC_Rep3 Terrestrial Act23
WT_FLT_Rep1 Microgravity WT
WT_FLT_Rep2 Microgravity WT
WT_FLT_Rep3 Microgravity WT
WT_GC_Rep1 Terrestrial WT
WT_GC_Rep2 Terrestrial WT
WT_GC_Rep3 Terrestrial WT
 input_selectOrg ="NEW" 
 input_selectGO <- 'GOBP'   #Gene set category 
 input_noIDConversion = TRUE  
 allGeneInfo.out <- geneInfo(geneInfoFile) 
 converted.out = NULL 
 convertedData.out <- convertedData()    
 nGenesFilter()  
## [1] "16156 genes in 12 samples. 16156  genes passed filter.\n Original gene IDs used."
 convertedCounts.out <- convertedCounts()  # converted counts, just for compatibility 

2. Pre-process

# Read counts per library 
 parDefault = par() 
 par(mar=c(12,4,2,2)) 
 # barplot of total read counts
 x <- readData.out$rawCounts
 groups = as.factor( detectGroups(colnames(x ) ) )
 if(nlevels(groups)<=1 | nlevels(groups) >20 )  
  col1 = 'green'  else
  col1 = rainbow(nlevels(groups))[ groups ]             
         
 barplot( colSums(x)/1e6, 
        col=col1,las=3, main="Total read counts (millions)")  

 readCountsBias()  # detecting bias in sequencing depth 
## [1] 0.0001428983
## [1] 1.802135e-06
## [1] 0.8935372
## [1] "Warning! Sequencing depth bias detected. Total read counts are significantly different among sample groups (p= 1.43e-04 ) based on ANOVA.  Total read counts seem to be correlated with factor Gravity (p= 1.80e-06 ).  "
 # Box plot 
 x = readData.out$data 
 boxplot(x, las = 2, col=col1,
    ylab='Transformed expression levels',
    main='Distribution of transformed data') 

 #Density plot 
 par(parDefault) 
## Warning in par(parDefault): graphical parameter "cin" cannot be set
## Warning in par(parDefault): graphical parameter "cra" cannot be set
## Warning in par(parDefault): graphical parameter "csi" cannot be set
## Warning in par(parDefault): graphical parameter "cxy" cannot be set
## Warning in par(parDefault): graphical parameter "din" cannot be set
## Warning in par(parDefault): graphical parameter "page" cannot be set
 densityPlot()       

 # Scatter plot of the first two samples 
 plot(x[,1:2],xlab=colnames(x)[1],ylab=colnames(x)[2], 
    main='Scatter plot of first two samples') 

 ####plot gene or gene family
 input_selectOrg ="BestMatch" 
 input_geneSearch <- 'HOXA' #Gene ID for searching 
 genePlot()  
## NULL
 input_useSD <- 'FALSE' #Use standard deviation instead of standard error in error bar? 
 geneBarPlotError()       
## NULL

3. Heatmap

 # hierarchical clustering tree
 x <- readData.out$data
 maxGene <- apply(x,1,max)
 # remove bottom 25% lowly expressed genes, which inflate the PPC
 x <- x[which(maxGene > quantile(maxGene)[1] ) ,] 
 plot(as.dendrogram(hclust2( dist2(t(x)))), ylab="1 - Pearson C.C.", type = "rectangle") 

 #Correlation matrix
 input_labelPCC <- TRUE #Show correlation coefficient? 
 correlationMatrix() 

 # Parameters for heatmap
 input_nGenes <- 1000   #Top genes for heatmap
 input_geneCentering <- TRUE    #centering genes ?
 input_sampleCentering <- FALSE #Center by sample?
 input_geneNormalize <- FALSE   #Normalize by gene?
 input_sampleNormalize <- FALSE #Normalize by sample?
 input_noSampleClustering <- FALSE  #Use original sample order
 input_heatmapCutoff <- 4   #Remove outliers beyond number of SDs 
 input_distFunctions <- 1   #which distant funciton to use
 input_hclustFunctions <- 1 #Linkage type
 input_heatColors1 <- 1 #Colors
 input_selectFactorsHeatmap <- NULL     #Sample coloring factors 
 png('heatmap.png', width = 10, height = 15, units = 'in', res = 300) 
 staticHeatmap() 
 dev.off()  
## png 
##   2

[heatmap] (heatmap.png)

 heatmapPlotly() # interactive heatmap using Plotly 

4. K-means clustering

 input_nGenesKNN <- 2000    #Number of genes fro k-Means
 input_nClusters <- 4   #Number of clusters 
 maxGeneClustering = 12000
 input_kmeansNormalization <- 'geneMean'    #Normalization
 input_KmeansReRun <- 0 #Random seed 

 distributionSD()  #Distribution of standard deviations 

 KmeansNclusters()  #Number of clusters 

 Kmeans.out = Kmeans()   #Running K-means 
 KmeansHeatmap()   #Heatmap for k-Means 

 #Read gene sets for enrichment analysis 
 sqlite  <- dbDriver('SQLite')
 input_selectGO3 <- NULL    #Gene set category
 input_minSetSize <- 15 #Min gene set size
 input_maxSetSize <- 2000   #Max gene set size 
 GeneSets.out <-readGeneSets( geneSetFile,
    convertedData.out, input_selectGO3,input_selectOrg,
    c(input_minSetSize, input_maxSetSize)  )  
 # Alternatively, users can use their own GMT files by
 #GeneSets.out <- readGMTRobust('somefile.GMT')  
 results <- KmeansGO()  #Enrichment analysis for k-Means clusters   
 results$adj.Pval <- format( results$adj.Pval,digits=3 )
 kable( results, row.names=FALSE) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%") 
Cluster adj.Pval Genes Pathways
A 1.81e-17 23 Drug catabolic process
7.90e-15 33 Cell wall organization or biogenesis
1.05e-14 16 Antibiotic catabolic process
4.75e-14 34 Drug metabolic process
8.88e-14 20 Detoxification
1.48e-13 40 Transmembrane transport
2.32e-13 14 Hydrogen peroxide catabolic process
3.69e-13 15 Hydrogen peroxide metabolic process
5.31e-13 18 Cellular response to toxic substance
5.89e-13 21 Plant-type cell wall organization or biogenesis
B 1.48e-25 116 Regulation of biological quality
1.10e-24 131 Oxidation-reduction process
2.29e-21 89 Ion transport
2.29e-21 83 Drug metabolic process
7.46e-21 116 Response to external stimulus
2.37e-20 102 Transmembrane transport
3.14e-20 92 Response to inorganic substance
5.64e-20 51 Secondary metabolic process
2.42e-19 111 Multi-organism process
2.48e-19 94 Carbohydrate metabolic process
C 2.68e-46 140 Response to abiotic stimulus
1.01e-38 52 Photosynthesis
4.72e-22 85 Cellular response to chemical stimulus
1.11e-21 98 Response to organic substance
3.73e-21 33 Cellular response to decreased oxygen levels
3.73e-21 33 Cellular response to oxygen levels
3.73e-21 33 Cellular response to hypoxia
1.04e-19 54 Response to light stimulus
1.20e-19 33 Response to hypoxia
1.77e-19 33 Response to decreased oxygen levels
D 4.31e-12 13 Photosynthesis
2.29e-07 8 Photosynthesis, light reaction
6.05e-07 11 Generation of precursor metabolites and energy
2.69e-06 8 Electron transport chain
2.49e-05 15 Oxidation-reduction process
1.40e-04 7 Purine nucleotide metabolic process
1.40e-04 6 Purine nucleoside triphosphate metabolic process
1.40e-04 7 Purine ribonucleotide metabolic process
1.40e-04 6 Purine ribonucleoside triphosphate metabolic process
1.40e-04 6 ATP metabolic process
 input_seedTSNE <- 0    #Random seed for t-SNE
 input_colorGenes <- TRUE   #Color genes in t-SNE plot? 
 tSNEgenePlot()  #Plot genes using t-SNE 

5. PCA and beyond

 input_selectFactors <- 'Sample_Name'   #Factor coded by color
 input_selectFactors2 <- 'Sample_Name'  #Factor coded by shape
 input_tsneSeed2 <- 0   #Random seed for t-SNE 
 #PCA, MDS and t-SNE plots
 PCAplot()  

 MDSplot() 

 tSNEplot()  

 #Read gene sets for pathway analysis using PGSEA on principal components 
 input_selectGO6 <- 'GOBP' 
 GeneSets.out <-readGeneSets( geneSetFile,
    convertedData.out, input_selectGO6,input_selectOrg,
    c(input_minSetSize, input_maxSetSize)  )  
 PCApathway() # Run PGSEA analysis 
## Warning: Package 'KEGG.db' is deprecated and will be removed from Bioconductor
##   version 3.12

 cat( PCA2factor() )   #The correlation between PCs with factors 
## 
##  Correlation between Principal Components (PCs) with factors
## PC1 is correlated with Gravity (p=8.59e-10).

6. DEG1

 input_CountsDEGMethod <- 2 #DESeq2= 3,limma-voom=2,limma-trend=1 
 input_limmaPval <- 0.1 #FDR cutoff
 input_limmaFC <- 2 #Fold-change cutoff
 input_selectModelComprions <- 'Gravity: Microgravity vs. Terrestrial'  #Selected comparisons
 input_selectFactorsModel <- 'Gravity'  #Selected comparisons
 input_selectInteractions <- NULL   #Selected comparisons
 input_selectBlockFactorsModel <- NULL  #Selected comparisons
 factorReferenceLevels.out <- c('Gravity:Terrestrial') 

 limma.out <- limma()
 DEG.data.out <- DEG.data()
 limma.out$comparisons 
## [1] "Microgravity-Terrestrial"
 input_selectComparisonsVenn = limma.out$comparisons[1:3] # use first three comparisons
 input_UpDownRegulated <- FALSE #Split up and down regulated genes 
 vennPlot() # Venn diagram 

  sigGeneStats() # number of DEGs as figure 

  sigGeneStatsTable() # number of DEGs as table 
##                                       Comparisons Up Down
## Microgravity-Terrestrial Microgravity-Terrestrial  0    4

7. DEG2

 input_selectContrast <- 'Microgravity-Terrestrial' #Selected comparisons 
 selectedHeatmap.data.out <- selectedHeatmap.data()
## Error in findContrastSamples(input_selectContrast, colnames(convertedData.out), : object 'c.out' not found
 selectedHeatmap()   # heatmap for DEGs in selected comparison
## Error in selectedHeatmap(): object 'selectedHeatmap.data.out' not found
 # Save gene lists and data into files
 write.csv( selectedHeatmap.data()$genes, 'heatmap.data.csv') 
## Error in findContrastSamples(input_selectContrast, colnames(convertedData.out), : object 'c.out' not found
 write.csv(DEG.data(),'DEG.data.csv' )
 write(AllGeneListsGMT() ,'AllGeneListsGMT.gmt')
 input_selectGO2 <- 'GOBP'  #Gene set category 
 geneListData.out <- geneListData()  
 volcanoPlot()  

  scatterPlot()  
## Error in findContrastSamples(input_selectContrast, colnames(convertedData.out), : object 'c.out' not found
  MAplot()  
## Error in findContrastSamples(input_selectContrast, colnames(convertedData.out), : object 'c.out' not found
  geneListGOTable.out <- geneListGOTable()  
## Error in geneListGOTable(): object 'selectedHeatmap.data.out' not found
 # Read pathway data again 
 GeneSets.out <-readGeneSets( geneSetFile,
    convertedData.out, input_selectGO2,input_selectOrg,
    c(input_minSetSize, input_maxSetSize)  ) 
 input_removeRedudantSets <- TRUE   #Remove highly redundant gene sets? 
 results <- geneListGO()  #Enrichment analysis
## Error in geneListGO(): object 'geneListGOTable.out' not found
 results$adj.Pval <- format( results$adj.Pval,digits=3 )
 kable( results, row.names=FALSE) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%") 
Cluster adj.Pval Genes Pathways
A 1.81e-17 23 Drug catabolic process
7.90e-15 33 Cell wall organization or biogenesis
1.05e-14 16 Antibiotic catabolic process
4.75e-14 34 Drug metabolic process
8.88e-14 20 Detoxification
1.48e-13 40 Transmembrane transport
2.32e-13 14 Hydrogen peroxide catabolic process
3.69e-13 15 Hydrogen peroxide metabolic process
5.31e-13 18 Cellular response to toxic substance
5.89e-13 21 Plant-type cell wall organization or biogenesis
B 1.48e-25 116 Regulation of biological quality
1.10e-24 131 Oxidation-reduction process
2.29e-21 89 Ion transport
2.29e-21 83 Drug metabolic process
7.46e-21 116 Response to external stimulus
2.37e-20 102 Transmembrane transport
3.14e-20 92 Response to inorganic substance
5.64e-20 51 Secondary metabolic process
2.42e-19 111 Multi-organism process
2.48e-19 94 Carbohydrate metabolic process
C 2.68e-46 140 Response to abiotic stimulus
1.01e-38 52 Photosynthesis
4.72e-22 85 Cellular response to chemical stimulus
1.11e-21 98 Response to organic substance
3.73e-21 33 Cellular response to decreased oxygen levels
3.73e-21 33 Cellular response to oxygen levels
3.73e-21 33 Cellular response to hypoxia
1.04e-19 54 Response to light stimulus
1.20e-19 33 Response to hypoxia
1.77e-19 33 Response to decreased oxygen levels
D 4.31e-12 13 Photosynthesis
2.29e-07 8 Photosynthesis, light reaction
6.05e-07 11 Generation of precursor metabolites and energy
2.69e-06 8 Electron transport chain
2.49e-05 15 Oxidation-reduction process
1.40e-04 7 Purine nucleotide metabolic process
1.40e-04 6 Purine nucleoside triphosphate metabolic process
1.40e-04 7 Purine ribonucleotide metabolic process
1.40e-04 6 Purine ribonucleoside triphosphate metabolic process
1.40e-04 6 ATP metabolic process

STRING-db API access. We need to find the taxonomy id of your species, this used by STRING. First we try to guess the ID based on iDEP’s database. Users can also skip this step and assign NCBI taxonomy id directly by findTaxonomyID.out = 10090 # mouse 10090, human 9606 etc.

 STRING10_species = read.csv(STRING10_speciesFile)  
 ix = grep('Arabidopsis thaliana', STRING10_species$official_name ) 
 findTaxonomyID.out <- STRING10_species[ix,1] # find taxonomyID
 findTaxonomyID.out  
## [1] 3702

Enrichment analysis using STRING

  STRINGdb_geneList.out <- STRINGdb_geneList() #convert gene lists
 input_STRINGdbGO <- 'Process'  #'Process', 'Component', 'Function', 'KEGG', 'Pfam', 'InterPro' 
 results <- stringDB_GO_enrichmentData()  # enrichment using STRING 
## Error in stringDB_GO_enrichmentData(): object 'selectedHeatmap.data.out' not found
 results$adj.Pval <- format( results$adj.Pval,digits=3 )
 kable( results, row.names=FALSE) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%") 
Cluster adj.Pval Genes Pathways
A 1.81e-17 23 Drug catabolic process
7.90e-15 33 Cell wall organization or biogenesis
1.05e-14 16 Antibiotic catabolic process
4.75e-14 34 Drug metabolic process
8.88e-14 20 Detoxification
1.48e-13 40 Transmembrane transport
2.32e-13 14 Hydrogen peroxide catabolic process
3.69e-13 15 Hydrogen peroxide metabolic process
5.31e-13 18 Cellular response to toxic substance
5.89e-13 21 Plant-type cell wall organization or biogenesis
B 1.48e-25 116 Regulation of biological quality
1.10e-24 131 Oxidation-reduction process
2.29e-21 89 Ion transport
2.29e-21 83 Drug metabolic process
7.46e-21 116 Response to external stimulus
2.37e-20 102 Transmembrane transport
3.14e-20 92 Response to inorganic substance
5.64e-20 51 Secondary metabolic process
2.42e-19 111 Multi-organism process
2.48e-19 94 Carbohydrate metabolic process
C 2.68e-46 140 Response to abiotic stimulus
1.01e-38 52 Photosynthesis
4.72e-22 85 Cellular response to chemical stimulus
1.11e-21 98 Response to organic substance
3.73e-21 33 Cellular response to decreased oxygen levels
3.73e-21 33 Cellular response to oxygen levels
3.73e-21 33 Cellular response to hypoxia
1.04e-19 54 Response to light stimulus
1.20e-19 33 Response to hypoxia
1.77e-19 33 Response to decreased oxygen levels
D 4.31e-12 13 Photosynthesis
2.29e-07 8 Photosynthesis, light reaction
6.05e-07 11 Generation of precursor metabolites and energy
2.69e-06 8 Electron transport chain
2.49e-05 15 Oxidation-reduction process
1.40e-04 7 Purine nucleotide metabolic process
1.40e-04 6 Purine nucleoside triphosphate metabolic process
1.40e-04 7 Purine ribonucleotide metabolic process
1.40e-04 6 Purine ribonucleoside triphosphate metabolic process
1.40e-04 6 ATP metabolic process

PPI network retrieval and analysis

 input_nGenesPPI <- 100 #Number of top genes for PPI retrieval and analysis 
 stringDB_network1(1) #Show PPI network 
## Error: Bad Request

Generating interactive PPI

 write(stringDB_network_link(), 'PPI_results.html') # write results to html file 
## Warning: 'string_db$get_link' is deprecated.
## Use 'Contact developers to request functionality' instead.
## See help("Deprecated")
## Error: Bad Request
 browseURL('PPI_results.html') # open in browser 

8. Pathway analysis

 input_selectContrast1 <- 'Microgravity-Terrestrial'    #select Comparison 
 #input_selectContrast1 = limma.out$comparisons[3] # manually set
 input_selectGO <- 'GOBP'   #Gene set category 
 #input_selectGO='custom' # if custom gmt file
 input_minSetSize <- 15 #Min size for gene set
 input_maxSetSize <- 2000   #Max size for gene set 
 # Read pathway data again 
 GeneSets.out <-readGeneSets( geneSetFile,
    convertedData.out, input_selectGO,input_selectOrg,
    c(input_minSetSize, input_maxSetSize)  ) 
 input_pathwayPvalCutoff <- 0.2 #FDR cutoff
 input_nPathwayShow <- 30   #Top pathways to show
 input_absoluteFold <- FALSE    #Use absolute values of fold-change?
 input_GenePvalCutoff <- 1  #FDR to remove genes 

 input_pathwayMethod = 1  # 1  GAGE
 gagePathwayData.out <- gagePathwayData()  # pathway analysis using GAGE  
   
 results <- gagePathwayData.out  #Enrichment analysis for k-Means clusters  
 results$adj.Pval <- format( results$adj.Pval,digits=3 )
 kable( results, row.names=FALSE) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%") 
Direction GAGE analysis: Microgravity vs Terrestrial statistic Genes adj.Pval
Down Plant-type cell wall organization or biogenesis -5.0109 228 6.4e-04
Drug catabolic process -4.8804 163 6.4e-04
Transition metal ion transport -4.8075 99 6.4e-04
Root development -4.6705 439 6.4e-04
Cell wall organization -4.6443 414 6.4e-04
Root system development -4.6372 440 6.4e-04
Phenylpropanoid biosynthetic process -4.5893 60 1.3e-03
External encapsulating structure organization -4.5662 437 7.8e-04
Root morphogenesis -4.5335 230 9.0e-04
Phenylpropanoid metabolic process -4.3839 93 2.0e-03
Lignin metabolic process -4.1894 52 6.1e-03
Antibiotic catabolic process -3.9421 78 8.4e-03
Plant organ morphogenesis -3.9281 327 7.5e-03
Detoxification -3.871 175 8.4e-03
Secondary metabolite biosynthetic process -3.8705 118 8.4e-03
Plant-type cell wall biogenesis -3.8484 134 8.4e-03
Cation homeostasis -3.8451 191 8.4e-03
Plant-type cell wall organization -3.8184 132 8.4e-03
Inorganic ion homeostasis -3.811 203 8.4e-03
Secondary metabolic process -3.7887 266 8.4e-03
Up Photosynthesis 6.5792 223 1.3e-07
Photosynthesis, light reaction 5.0342 119 4.8e-04
RNA modification 4.6022 321 1.6e-03
Response to light intensity 4.4483 133 2.5e-03
Plastid organization 4.4326 257 2.5e-03
RRNA processing 4.3198 239 3.2e-03
RRNA metabolic process 4.2747 244 3.3e-03
NcRNA processing 4.2168 357 3.4e-03
NcRNA metabolic process 3.9191 425 9.2e-03
Ribonucleoprotein complex biogenesis 3.9178 438 9.2e-03
 pathwayListData.out = pathwayListData() 
 enrichmentPlot(pathwayListData.out, 25  ) 

  enrichmentNetwork(pathwayListData.out )  

  enrichmentNetworkPlotly(pathwayListData.out) 

## Warning: `arrange_()` is deprecated as of dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
 input_pathwayMethod = 3  # 1  fgsea 
 fgseaPathwayData.out <- fgseaPathwayData() #Pathway analysis using fgsea 
## Warning in fgsea(pathways = gmt, stats = fold, minSize = input_minSetSize, :
## You are trying to run fgseaSimple. It is recommended to use fgseaMultilevel. To
## run fgseaMultilevel, you need to remove the nperm argument in the fgsea function
## call.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (70.33% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
 results <- fgseaPathwayData.out  #Enrichment analysis for k-Means clusters 
 results$adj.Pval <- format( results$adj.Pval,digits=3 )
 kable( results, row.names=FALSE) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%") 
Direction GSEA analysis: Microgravity vs Terrestrial NES Genes adj.Pval
Down Antibiotic catabolic process -2.1412 78 3.3e-03
Drug catabolic process -2.1265 163 3.3e-03
Hydrogen peroxide catabolic process -2.1243 65 3.3e-03
Transition metal ion transport -2.0774 99 3.3e-03
Lignin metabolic process -2.0739 52 3.3e-03
Phenylpropanoid metabolic process -2.0666 93 3.3e-03
Hydrogen peroxide metabolic process -2.0568 84 3.3e-03
Phenylpropanoid biosynthetic process -2.0529 60 3.3e-03
Plant-type cell wall organization or biogenesis -2.0501 228 3.3e-03
Root morphogenesis -1.9956 230 3.3e-03
Plant-type cell wall biogenesis -1.9887 134 3.3e-03
Cofactor catabolic process -1.9882 95 3.3e-03
Regulation of root development -1.9774 66 3.3e-03
Plant-type secondary cell wall biogenesis -1.9732 66 3.3e-03
Trichoblast differentiation -1.9675 102 3.3e-03
Lignin biosynthetic process -1.9671 35 3.5e-03
Cellular response to toxic substance -1.9659 148 3.3e-03
Plant epidermal cell differentiation -1.9637 132 3.3e-03
Detoxification -1.9531 175 3.3e-03
Iron ion transport -1.9474 53 3.3e-03
Cellular oxidant detoxification -1.9471 128 3.3e-03
Up Photosynthesis 2.4734 223 1.4e-02
Photosynthesis, light reaction 2.4514 119 9.6e-03
Photosynthetic electron transport chain 2.2626 46 6.7e-03
Protein-chromophore linkage 2.0953 39 6.4e-03
Photosynthesis, light harvesting 2.081 31 6.1e-03
Photosystem II assembly 2.0767 25 1.0e-02
Response to light intensity 2.0635 133 1.0e-02
Response to high light intensity 1.9944 68 7.7e-03
Chloroplast rRNA processing 1.949 18 5.5e-03
  pathwayListData.out = pathwayListData() 
 enrichmentPlot(pathwayListData.out, 25  ) 

  enrichmentNetwork(pathwayListData.out )  

  enrichmentNetworkPlotly(pathwayListData.out) 

   PGSEAplot() # pathway analysis using PGSEA 
## Error in findContrastSamples(input_selectContrast1, colnames(convertedData.out), : object 'c.out' not found

9. Chromosome

 input_selectContrast2 = limma.out$comparisons[1] 
 #input_selectContrast2 = limma.out$comparisons[3] # manually set
 input_limmaPvalViz <- 0.1  #FDR to filter genes
 input_limmaFCViz <- 2  #FDR to filter genes 
 genomePlotly() # shows fold-changes on the genome 
## Warning in eval(quote(list(...)), env): NAs introduced by coercion
## Warning in genomePlotly(): NAs introduced by coercion

10. Biclustering

 input_nGenesBiclust <- 1000    #Top genes for biclustering
 input_biclustMethod <- 'BCCC()'    #Method: 'BCCC', 'QUBIC', 'runibic' ... 
 biclustering.out = biclustering()  # run analysis

 input_selectBicluster <- NULL  #select a cluster 
 biclustHeatmap()   # heatmap for selected cluster 
## Error in res[[i]] <- x[BicRes@RowxNumber[, number[i]], BicRes@NumberxCol[number[i], : attempt to select less than one element in integerOneIndex
 input_selectGO4 = 'GOBP'  # gene set category 
 # Read pathway data again 
 GeneSets.out <-readGeneSets( geneSetFile,
    convertedData.out, input_selectGO4,input_selectOrg,
    c(input_minSetSize, input_maxSetSize)  )  
 results <- geneListBclustGO()  #Enrichment analysis for k-Means clusters   
## Error in res[[i]] <- x[BicRes@RowxNumber[, number[i]], BicRes@NumberxCol[number[i], : attempt to select less than one element in integerOneIndex
 results$adj.Pval <- format( results$adj.Pval,digits=3 )
 kable( results, row.names=FALSE) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%") 
Direction GSEA analysis: Microgravity vs Terrestrial NES Genes adj.Pval
Down Antibiotic catabolic process -2.1412 78 3.3e-03
Drug catabolic process -2.1265 163 3.3e-03
Hydrogen peroxide catabolic process -2.1243 65 3.3e-03
Transition metal ion transport -2.0774 99 3.3e-03
Lignin metabolic process -2.0739 52 3.3e-03
Phenylpropanoid metabolic process -2.0666 93 3.3e-03
Hydrogen peroxide metabolic process -2.0568 84 3.3e-03
Phenylpropanoid biosynthetic process -2.0529 60 3.3e-03
Plant-type cell wall organization or biogenesis -2.0501 228 3.3e-03
Root morphogenesis -1.9956 230 3.3e-03
Plant-type cell wall biogenesis -1.9887 134 3.3e-03
Cofactor catabolic process -1.9882 95 3.3e-03
Regulation of root development -1.9774 66 3.3e-03
Plant-type secondary cell wall biogenesis -1.9732 66 3.3e-03
Trichoblast differentiation -1.9675 102 3.3e-03
Lignin biosynthetic process -1.9671 35 3.5e-03
Cellular response to toxic substance -1.9659 148 3.3e-03
Plant epidermal cell differentiation -1.9637 132 3.3e-03
Detoxification -1.9531 175 3.3e-03
Iron ion transport -1.9474 53 3.3e-03
Cellular oxidant detoxification -1.9471 128 3.3e-03
Up Photosynthesis 2.4734 223 1.4e-02
Photosynthesis, light reaction 2.4514 119 9.6e-03
Photosynthetic electron transport chain 2.2626 46 6.7e-03
Protein-chromophore linkage 2.0953 39 6.4e-03
Photosynthesis, light harvesting 2.081 31 6.1e-03
Photosystem II assembly 2.0767 25 1.0e-02
Response to light intensity 2.0635 133 1.0e-02
Response to high light intensity 1.9944 68 7.7e-03
Chloroplast rRNA processing 1.949 18 5.5e-03

11. Co-expression network

 input_mySoftPower <- 5 #SoftPower to cutoff
 input_nGenesNetwork <- 1000    #Number of top genes
 input_minModuleSize <- 20  #Module size minimum 
 wgcna.out = wgcna()   # run WGCNA  
## Warning: executing %dopar% sequentially: no parallel backend registered
##    Power SFT.R.sq   slope truncated.R.sq mean.k. median.k. max.k.
## 1      1  0.87300  2.0900          0.975   649.0     703.0    795
## 2      2  0.81600  0.9010          0.976   481.0     534.0    677
## 3      3  0.60400  0.4400          0.849   379.0     419.0    595
## 4      4  0.30500  0.1910          0.800   310.0     337.0    533
## 5      5  0.00209  0.0137          0.447   260.0     275.0    484
## 6      6  0.09600 -0.1210          0.393   223.0     227.0    446
## 7      7  0.30300 -0.2300          0.409   194.0     189.0    414
## 8      8  0.34700 -0.3160          0.300   171.0     159.0    387
## 9      9  0.40700 -0.4060          0.354   152.0     134.0    364
## 10    10  0.44000 -0.4960          0.312   137.0     114.0    344
## 11    12  0.50900 -0.5760          0.386   113.0      84.1    312
## 12    14  0.47200 -0.7170          0.325    96.1      62.7    287
## 13    16  0.48400 -0.8170          0.338    83.4      47.3    267
## 14    18  0.51300 -0.8410          0.378    73.6      35.9    251
## 15    20  0.44500 -1.0200          0.291    65.9      27.5    238
## TOM calculation: adjacency..
## ..will not use multithreading.
##  Fraction of slow calculations: 0.000000
## ..connectivity..
## ..matrix multiplication (system BLAS)..
## ..normalization..
## ..done.
 softPower()  # soft power curve 

  modulePlot()  # plot modules  

  listWGCNA.Modules.out = listWGCNA.Modules() #modules
 input_selectGO5 <- 'GOBP'  #Gene set category 
 # Read pathway data again 
 GeneSets.out <-readGeneSets( geneSetFile,
    convertedData.out, input_selectGO5,input_selectOrg,
    c(input_minSetSize, input_maxSetSize)  ) 
 input_selectWGCNA.Module <- '1. turquoise (967 genes)' #Select a module
 input_topGenesNetwork <- 10    #SoftPower to cutoff
 input_edgeThreshold <- 0.4 #Number of top genes 
 moduleNetwork()    # show network of top genes in selected module
##  softConnectivity: FYI: connecitivty of genes with less than 4 valid samples will be returned as NA.
##  ..calculating connectivities..
## Error in `[<-`(`*tmp*`, i, i, value = FALSE): subscript out of bounds
 input_removeRedudantSets <- TRUE   #Remove redundant gene sets 
 results <- networkModuleGO()  #Enrichment analysis of selected module
 results$adj.Pval <- format( results$adj.Pval,digits=3 )
 kable( results, row.names=FALSE) %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  scroll_box(width = "100%") 
adj.Pval Genes Pathways
1.2e-34 89 Cell wall organization or biogenesis
2.9e-31 97 Ion transport
6.3e-30 89 Drug metabolic process
4.3e-29 127 Oxidation-reduction process
8.2e-28 106 Transmembrane transport
1.5e-26 68 Cell wall organization
4.7e-26 44 Drug catabolic process
3.0e-25 68 External encapsulating structure organization
7.0e-24 67 Cation transport
4.1e-22 68 Ion transmembrane transport